#include <iostream>
#include <pthread.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cassert>
using namespace std;
void* start_routine(void* arg)
{
    while (true)
    {
        cout << (char*)arg << endl;
        sleep(1);
    }
}
int main()
{
    pthread_t tid;
    int n = pthread_create(&tid, NULL, start_routine, (void*)("new thread"));
    assert(0 == n);
    while (true)
    {
        cout << "main thread" << endl;
        sleep(1);
    }
    return 0;
}